home *** CD-ROM | disk | FTP | other *** search
/ Macintosh Programmer's Tool Box Assistant / Macintosh Programmer's Tool Box Assistant.iso / Goodies / Toolbox Asst. Tools for MPW / UserStartup•MPTA < prev   
Encoding:
Text File  |  1995-01-12  |  1.8 KB  |  55 lines  |  [TEXT/MPS ]

  1. # Macintosh Programmer’s Toolbox Assistant
  2. # Copyright © 1986-1995 Apple Computer, Inc. All rights reserved.
  3. #
  4. # -- brain surgery provided by the MPW Gurus, 1/12/95
  5. #
  6. # ------------------------------- #
  7. # UserStartup•MPTA
  8. # ------------------------------- #
  9. #
  10. # Put this file in the same folder as the MPW Shell.
  11. #
  12. # This startup script defines the {MPTA_Location} and {MPTA_AppName} variables
  13. # for use by the MPTA_MPWAccess script.
  14. #
  15. # It also adds a menu called "MPTA" to the MPW Shell menu bar with items that
  16. # let you look up the description of a toolbox routine or return the C template
  17. # for a toolbox routine.
  18. #
  19.  
  20. set saveExit {Exit}
  21. set exit 0
  22. set hasSendAE "`which SendAE ≥dev:null`"
  23. if "{hasSendAE}" ≠ ""
  24.      Addmenu "MPTA" "Look up/E" ('MPTA_MPWAccess Lookup')
  25.      Addmenu "MPTA" "Template/1" ('MPTA_MPWAccess GetTemplate')
  26.     
  27.     #    Set the location of the Macintosh Programmer’s Toolbox Assistant folder.
  28.     #         If the folder can’t be found, prompt the user for it and remember
  29.     #         where the folder was found.
  30.     
  31.     if  ¬ "{MPTA_Location}" && "`Exists "{ShellDirectory}"MPTA_FullPathName`" 
  32.         Set MPTA_Location     "`Catenate "{ShellDirectory}"MPTA_FullPathName`"
  33.     End
  34.     
  35.     If ¬ "`Exists "{ShellDirectory}"MPTA_FullPathName`" || ¬ "`Exists "{MPTA_Location}"`"
  36.         Set exit 0
  37.         Set temp "{ShellDirectory}"
  38.         Set temp "`(GetFileName "{temp}" -b "Here It Is" -t APPL -q -m "Locate the QuickView application.") ≥ dev:null`"
  39.         IF "{temp}"!= ""
  40.             Echo -n "{temp}" > "{ShellDirectory}"MPTA_FullPathName
  41.         END
  42.         set exit 1
  43.     END
  44.     
  45.     Set MPTA_Location "`Catenate "{ShellDirectory}"MPTA_FullPathName`"
  46.     (evaluate "{MPTA_Location}" =~ /(([¬:]+:)*)(≈)®1/ ) > Dev:Null
  47.     Set MPTA_AppName "{®1}"
  48.     Export MPTA_Location MPTA_AppName
  49. else    
  50.     Alert "Macintosh Programmer’s Toolbox Assistant cannot locate the ‘SendAE’ tool.  Please reinstall MPTA properly."
  51. end
  52.  
  53. set exit {saveExit}
  54. unset hasSendAE saveExit
  55.